package com.kxf.androidtestdemo.view;

import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;

/**
 * @ProjectName: AndroidTestDemo
 * @Package: com.kxf.androidtestdemo.view
 * @ClassName: MyLinearLayout
 * @Description: java类作用描述
 * @Author: kuangxuefeng
 * @qq: 1024883177
 * @CreateDate: 2020/6/28 10:07
 */
public class MyLinearLayout extends LinearLayout {
    public MyLinearLayout(Context context) {
        super(context);
    }

    public MyLinearLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public MyLinearLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    public MyLinearLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        Log.d("MyLinearLayout", "=====>>>onInterceptTouchEvent" + "  event=" + ev);
        boolean b =  super.onInterceptTouchEvent(ev);
        Log.d("MyLinearLayout", "=====>>>onInterceptTouchEvent" + "  b=" + b);
        return b;
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.d("MyLinearLayout", "=====>>>dispatchTouchEvent" + "  event=" + ev);
        boolean b = super.dispatchTouchEvent(ev);
        Log.d("MyLinearLayout", "=====>>>dispatchTouchEvent" + "  b=" + b);
        return b;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.d("MyLinearLayout", "=====>>>onTouchEvent" + "  event=" + event);
        boolean b = super.onTouchEvent(event);
        Log.d("MyLinearLayout", "=====>>>onTouchEvent" + "  b=" + b);
        return b;
    }
}
